package com.sgam.mf.domain.entity;


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import com.sgam.mf.domain.ref.RefAssCompany;
import com.sgam.mf.domain.ref.RefCurrency;
import com.sgam.mf.domain.ref.RefObjectAss;
import com.sgam.utils.CustomDateDeserializer;
import com.sgam.utils.CustomDateSerializer;

@Entity
@Table(name = "CONTRACT_ASIG")
public class ContractAsig {

		@Id
		@Column(name = "id")
		@GeneratedValue
		private Integer id;
		
		@Column(name = "amount") 
		private Long amount;

		@JsonSerialize(using = CustomDateSerializer.class)
		@JsonDeserialize(using = CustomDateDeserializer.class)
		@DateTimeFormat(pattern="dd.MM.yyyy")
		@Column(name = "date_from") 
		private Date dateFrom;

		@JsonSerialize(using = CustomDateSerializer.class)
		@JsonDeserialize(using = CustomDateDeserializer.class)
		@DateTimeFormat(pattern="dd.MM.yyyy")
		@Column(name = "date_to") 
		private Date dateTo;
		
//		@Column(name = "payment_mode") 
//		private String paymentMode;
		
		@Column(name = "ass_object") 
		private String assObject;
		
		@ManyToOne
		@JoinColumn(name = "ref_currency_fk") 
		private RefCurrency refCurrency;
		
		@ManyToOne
		@JoinColumn(name = "ref_ass_company_fk") 
		private RefAssCompany refAssCompany;
		
		@JsonSerialize(using = CustomDateSerializer.class)
		@JsonDeserialize(using = CustomDateDeserializer.class)
		@DateTimeFormat(pattern="dd.MM.yyyy")
		@Column(name = "data_curr") 
		private Date dataCurr;
		
		@Column(name = "amount_lei") 
		private Integer amountLei;
		
		@Column(name = "procent") 
		private Float procent;
		
//		@Column(name = "prima") 
//		private Integer prima;
		
		@Column(name = "bank_branch") 
		private String bankBranch;
		
		@Column(name = "bank_address") 
		private String bankAddress;
		
		@Column(name = "acc_boli_flg") 
		private Integer accBoliFlg;
		
		@Column(name = "acc_spital_flg") 
		private Integer accSpitalFlg;
		
		@Column(name = "acc_sanatte_flg") 
		private Integer accSanatteFlg;
		
		@Column(name = "acc_deces_flg") 
		private Integer accDecesFlg;
		
		@Column(name = "acc_deces_inv_flg") 
		private Integer accDecesInvFlg;
		
		@Column(name = "acc_deces_inv3_flg") 
		private Integer accDecesInv3Flg;
		
		@Column(name = "acc_deces_inv_trauma_flg") 
		private Integer accDecesInvTraumaFlg;
		
		@Column(name = "acc_protectie1_flg") 
		private Integer accProtectie1Flg;
		
		@Column(name = "acc_protectie2_flg") 
		private Integer accProtectie2Flg;
		
		@Column(name = "acc_protectie3_flg") 
		private Integer accProtectie3Flg;
		
		@ManyToOne
		@JoinColumn(name = "bun_ref_object_ass_fk") 
		private RefObjectAss refObjectAss;
		
		@Column(name = "bun_incendiu_flg") 
		private Integer bunIncendiuFlg;
		
		@Transient
		private String bunIncendiuFlgX;
		
		@Column(name = "bun_inundatie_flg") 
		private Integer bunInundatieFlg;
		
		@Transient
		private String bunInundatieFlgX;
		
		@Column(name = "bun_deteriorare_flg") 
		private Integer bunDeteriorareFlg;
		
		@Transient
		private String bunDeteriorareFlgX;
		
		@Column(name = "bun_actiuni_flg") 
		private Integer bunActiuniFlg;
		
		@Transient
		private String bunActiuniFlgX;
		
		@Column(name = "bun_general_flg") 
		private Integer bunGeneralFlg;
		
		@Transient
		private String bunGeneralFlgX;

		@Column(name = "bun_address") 
		private String bunAddress;
		
		@Column(name = "bun_nr_cadastral") 
		private String bunNrCadastral;
		
		@Column(name = "bun_loc") 
		private String bunLoc;
		
		
		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}


		public Long getAmount() {
			return amount;
		}

		public void setAmount(Long amount) {
			this.amount = amount;
		}

		public Date getDateFrom() {
			return dateFrom;
		}

		public void setDateFrom(Date dateFrom) {
			this.dateFrom = dateFrom;
		}

		public Date getDateTo() {
			return dateTo;
		}

		public void setDateTo(Date dateTo) {
			this.dateTo = dateTo;
		}

//		public String getPaymentMode() {
//			return paymentMode;
//		}
//
//		public void setPaymentMode(String paymentMode) {
//			this.paymentMode = paymentMode;
//		}

		public String getAssObject() {
			return assObject;
		}

		public void setAssObject(String assObject) {
			this.assObject = assObject;
		}

		public RefCurrency getRefCurrency() {
			return refCurrency;
		}

		public void setRefCurrency(RefCurrency refCurrency) {
			this.refCurrency = refCurrency;
		}

		public Date getDataCurr() {
			return dataCurr;
		}

		public void setDataCurr(Date dataCurr) {
			this.dataCurr = dataCurr;
		}

		public Integer getAmountLei() {
			return amountLei;
		}

		public void setAmountLei(Integer amountLei) {
			this.amountLei = amountLei;
		}

		public Integer getAccBoliFlg() {
			return accBoliFlg;
		}

		public void setAccBoliFlg(Integer accBoliFlg) {
			this.accBoliFlg = accBoliFlg;
		}

		public Integer getAccSpitalFlg() {
			return accSpitalFlg;
		}

		public void setAccSpitalFlg(Integer accSpitalFlg) {
			this.accSpitalFlg = accSpitalFlg;
		}

		public Integer getAccSanatteFlg() {
			return accSanatteFlg;
		}

		public void setAccSanatteFlg(Integer accSanatteFlg) {
			this.accSanatteFlg = accSanatteFlg;
		}

		public Integer getAccDecesFlg() {
			return accDecesFlg;
		}

		public void setAccDecesFlg(Integer accDecesFlg) {
			this.accDecesFlg = accDecesFlg;
		}

		public Integer getAccDecesInvFlg() {
			return accDecesInvFlg;
		}

		public void setAccDecesInvFlg(Integer accDecesInvFlg) {
			this.accDecesInvFlg = accDecesInvFlg;
		}

		public Integer getAccDecesInv3Flg() {
			return accDecesInv3Flg;
		}

		public void setAccDecesInv3Flg(Integer accDecesInv3Flg) {
			this.accDecesInv3Flg = accDecesInv3Flg;
		}

		public Integer getAccDecesInvTraumaFlg() {
			return accDecesInvTraumaFlg;
		}

		public void setAccDecesInvTraumaFlg(Integer accDecesInvTraumaFlg) {
			this.accDecesInvTraumaFlg = accDecesInvTraumaFlg;
		}

		public Integer getAccProtectie1Flg() {
			return accProtectie1Flg;
		}

		public void setAccProtectie1Flg(Integer accProtectie1Flg) {
			this.accProtectie1Flg = accProtectie1Flg;
		}

		public Integer getAccProtectie2Flg() {
			return accProtectie2Flg;
		}

		public void setAccProtectie2Flg(Integer accProtectie2Flg) {
			this.accProtectie2Flg = accProtectie2Flg;
		}

		public Integer getAccProtectie3Flg() {
			return accProtectie3Flg;
		}

		public void setAccProtectie3Flg(Integer accProtectie3Flg) {
			this.accProtectie3Flg = accProtectie3Flg;
		}

		public RefObjectAss getRefObjectAss() {
			return refObjectAss;
		}

		public void setRefObjectAss(RefObjectAss refObjectAss) {
			this.refObjectAss = refObjectAss;
		}

		public Integer getBunIncendiuFlg() {
			return bunIncendiuFlg;
		}

		public void setBunIncendiuFlg(Integer bunIncendiuFlg) {
			this.bunIncendiuFlg = bunIncendiuFlg;
		}

		public Integer getBunInundatieFlg() {
			return bunInundatieFlg;
		}

		public void setBunInundatieFlg(Integer bunInundatieFlg) {
			this.bunInundatieFlg = bunInundatieFlg;
		}

		public Integer getBunDeteriorareFlg() {
			return bunDeteriorareFlg;
		}

		public void setBunDeteriorareFlg(Integer bunDeteriorareFlg) {
			this.bunDeteriorareFlg = bunDeteriorareFlg;
		}

		public Integer getBunActiuniFlg() {
			return bunActiuniFlg;
		}

		public void setBunActiuniFlg(Integer bunActiuniFlg) {
			this.bunActiuniFlg = bunActiuniFlg;
		}

		public Integer getBunGeneralFlg() {
			return bunGeneralFlg;
		}

		public void setBunGeneralFlg(Integer bunGeneralFlg) {
			this.bunGeneralFlg = bunGeneralFlg;
		}

		public Float getProcent() {
			return procent;
		}

		public void setProcent(Float procent) {
			this.procent = procent;
		}

		public RefAssCompany getRefAssCompany() {
			return refAssCompany;
		}

		public void setRefAssCompany(RefAssCompany refAssCompany) {
			this.refAssCompany = refAssCompany;
		}

//		public Integer getPrima() {
//			return prima;
//		}
//
//		public void setPrima(Integer prima) {
//			this.prima = prima;
//		}

		public String getBunAddress() {
			return bunAddress;
		}

		public void setBunAddress(String bunAddress) {
			this.bunAddress = bunAddress;
		}

		public String getBunNrCadastral() {
			return bunNrCadastral;
		}

		public void setBunNrCadastral(String bunNrCadastral) {
			this.bunNrCadastral = bunNrCadastral;
		}

		public String getBunLoc() {
			return bunLoc;
		}

		public void setBunLoc(String bunLoc) {
			this.bunLoc = bunLoc;
		}

		public String getBunIncendiuFlgX() {
			if (getBunIncendiuFlg()==1){
				return "X";
			}
			else return "";
		}

		public String getBunInundatieFlgX() {
			if (getBunInundatieFlg()==1){
				return "X";
			}
			else return "";
		}

		public String getBunDeteriorareFlgX() {
			if (getBunDeteriorareFlg()==1){
				return "X";
			}
			else return "";
		}

		public String getBunActiuniFlgX() {
			if (getBunActiuniFlg()==1){
				return "X";
			}
			else return "";
		}

		public String getBunGeneralFlgX() {
			if (getBunGeneralFlg()==1){
				return "X";
			}
			else return "";
		}

		public String getBankBranch() {
			return bankBranch;
		}

		public void setBankBranch(String bankBranch) {
			this.bankBranch = bankBranch;
		}

		public String getBankAddress() {
			return bankAddress;
		}

		public void setBankAddress(String bankAddress) {
			this.bankAddress = bankAddress;
		}
		



		

}
